import React from 'react';
import { Link } from 'react-router-dom';
import './index.css';

interface IProps extends IUser {}

const RecentList: React.FunctionComponent<IProps> = ({ recent_topics }) => {
  return (
    <ul className="recent-topics">
      {recent_topics.map((item, index) => {
        return (
          <li key={item.id}>
            <Link to={`/topic/${item.id}`} className="link-item" key={index}>
              {item.title}
            </Link>
          </li>
        );
      })}
    </ul>
  );
};

export default RecentList;
